package com.justonetech.translation.domain.base;

import com.justonetech.translation.domain.Bill;
import com.justonetech.translation.domain.BillDetail;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import java.io.Serializable;


/**
 * This is an object that contains data related to the bill_detail table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 * TableComment : 账单明细
 * SyncTemplatepatterns : list\w*
 * SyncDao : false
 * TableName : 账单明细
 * SyncBoolean : get
 * SyncJsp : true
 * Treeable : false
 * Projectable : false
 *
 * @hibernate.class
 *  table="bill_detail"
 */
@JsonIgnoreProperties(value={"hibernateLazyInitializer"})
public abstract class BaseBillDetail  implements Serializable{

	public static String REF = "BillDetail";
	public static String PROP_BILL = "bill";
	public static String PROP_AMOUNT = "amount";
	public static String PROP_HAND_DATE = "handDate";
	public static String PROP_PAY_DATE = "payDate";
	public static String PROP_HANDLER = "handler";
	public static String PROP_ID = "id";


	// constructors
	public BaseBillDetail () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseBillDetail (Long id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private Long id;

	// fields
    /*支付金额*/
    /*支付金额*/
	private Double amount;
	
    /*支付日期*/
    /*支付日期*/
	private java.sql.Date payDate;
	
    /*记账日期*/
    /*记账日期*/
	private java.sql.Date handDate;
	
    /*经手人*/
    /*经手人*/
	private String handler;
	

	// many to one
	private Bill bill;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="com.justonetech.core.orm.hibernate.LongIdGenerator"
     *  column="ID"
     */
	public Long getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 * @deprecated
	 */
	public void setId (Long id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: AMOUNT
	 */
	public Double getAmount () {
		return amount;
	}

	/**
	 * Set the value related to the column: AMOUNT
	 * @param amount the AMOUNT value
	 */
	public void setAmount (Double amount) {
		this.amount = amount;
	}


	/**
	 * Return the value associated with the column: PAY_DATE
	 */
	public java.sql.Date getPayDate () {
		return payDate;
	}

	/**
	 * Set the value related to the column: PAY_DATE
	 * @param payDate the PAY_DATE value
	 */
	public void setPayDate (java.sql.Date payDate) {
		this.payDate = payDate;
	}


	/**
	 * Return the value associated with the column: HAND_DATE
	 */
	public java.sql.Date getHandDate () {
		return handDate;
	}

	/**
	 * Set the value related to the column: HAND_DATE
	 * @param handDate the HAND_DATE value
	 */
	public void setHandDate (java.sql.Date handDate) {
		this.handDate = handDate;
	}


	/**
	 * Return the value associated with the column: HANDLER
	 */
	public String getHandler () {
		return handler;
	}

	/**
	 * Set the value related to the column: HANDLER
	 * @param handler the HANDLER value
	 */
	public void setHandler (String handler) {
		this.handler = handler;
	}


	/**
	 * Return the value associated with the column: BILL_ID
	 */
	public Bill getBill () {
		return bill;
	}

	/**
	 * Set the value related to the column: BILL_ID
	 * @param bill the BILL_ID value
	 */
	public void setBill (Bill bill) {
		this.bill = bill;
	}



	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof BillDetail)) return false;
		else {
			BillDetail billDetail = (BillDetail) obj;
			if (null == this.getId() || null == billDetail.getId()) return false;
			else return (this.getId().equals(billDetail.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		ToStringBuilder builder = new ToStringBuilder(this);
		builder.append(id);
        builder.append(bill);
		builder.append(amount);
		builder.append(payDate);
		builder.append(handDate);
		builder.append(handler);
		return builder.toString();
	}


}